Skip to content

fix(aggregator): post-alert rejects unknown/duplicated arguments (#7289) - #7295

Merged
dezren39 merged 1 commit into
mainfrom
creator-a/7289-post-alert-unknown-args
Nov 8, 2026
Merged

dezren39 merged 1 commit into
mainfrom
creator-a/7289-post-alert-unknown-args

Conversation

@developing-today

@developing-today developing-today Bot commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #7289.

post-alert.ts probed argv only with indexOf, so unknown/misspelled/joined/duplicated arguments and stray positionals were silently ignored: a typo'd --severty posted a warning incident as critical (the ?? "critical" default), --severity=warning did the same, and a typo'd --bodi silently dropped the body — all exit 0 (probe: ~/git/fleet/probe-post-alert-unknown-args, stub intake + stub bws, real script verbatim).

Fix: rejectUnknownArgs() in scripts/post-alert.ts, mirroring generate-digest.ts (#7097) / collect-github-billing.ts (#7254) — every argv token must be one of the five documented value flags, each at most once; anything else is a usage error naming the token, exit 2, before any token resolution or fetch. A flag's value token is consumed by its flag; arg() still validates it (#3723 behavior unchanged).

Tests: new test/post-alert-unknown-args-7289.test.ts (subprocess + stub intake/bws, the #3723 pattern) — control posts exactly the named incident; typo'd --severty, joined --severity=warning, unknown --bogus, typo'd --bodi, duplicate --severity, and a stray positional each exit 2 with no bws call and no POST. Verified on the laptop: new + #3723 suites 5/5 pass on the branch; the new regression test fails on the pre-fix script (control passes).


Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

@developing-today
developing-today Bot requested review from a team and dezren39 as code owners November 8, 2026 05:01
@coderabbitai

coderabbitai Bot commented Nov 8, 2026

Copy link
Copy Markdown

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 49bff0b0-17f3-46dc-9e90-a4579904f6fd

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant